package com.myjava.linkedhashset;

import java.util.HashSet;
import java.util.Random;
//随机生产20个整数
public class RandomSethashdemo {
    public static void main(String[] args) {
     Random r=  new Random();
        HashSet<Integer> hs = new HashSet<>();
        while(hs.size()<10){
           Integer ret=r.nextInt(20)+1;
           hs.add(ret);
        }
        System.out.println(hs);
    }
}
